#include <iostream>
using std::cout;
using std::endl;

void test0(){
    //int & re;//error 引用无法单独存在

    int number = 1;
    int number2 = 2;
    //这里既是引用的声明，又是初始化（绑定）
    int & ref = number;

    cout << ref << endl;
    cout << &number << endl;
    cout << &ref << endl;
    ref = 100;
    cout << number << endl;

    //引用一经绑定，无法换绑
    //这里不是换绑，只是把number2的值传给了ref
    ref = number2;
    cout << &number << endl;
    cout << &ref << endl;
    cout << number << endl;

}

int main(void){
    test0();
    return 0;
}
